#include <iostream>
using namespace std;

int main()
{
    float a;
    char b;
    cin >> a >> b;
    int x = (int)a;
    int ans = 0;
    if (x == 0 && x < a)
        ans += 20;
    if (x >= 1)
    {
        ans += x + 19;
        if (x < a)  ans += 1;
    }
    if (b == 'y') ans += 5;
    cout << ans << endl;

    return  0;
}
